<template>
  <div class="pb-88">
    <cellItem v-if="productMaterial.elec_material && productMaterial.elec_material.length">
      <cellTitle title="电子材料" :num="productMaterial.elec_material.length" />
      <cellMaterial :uploadOrViewType="1" :material="item" v-for="(item,index) in productMaterial.elec_material" :is_required="item.is_required" :leftText="item.material_name" :rightText="(item.fileList && item.fileList.length)?'重新上传':'待上传'" />
    </cellItem>
    <cellItem v-if="productMaterial && productMaterial.idphoto">
      <cellTitle title="证件照" :num="1" />
      <cellMaterial :uploadOrViewType="1" :material="productMaterial.idphoto" :is_required="productMaterial.idphoto.is_required" :leftText="productMaterial.idphoto.photo_name" :rightText="(productMaterial.idphoto.fileList && productMaterial.idphoto.fileList.length)?'重新上传':'待上传'" />
    </cellItem>
    <cellItem v-if="productMaterial && productMaterial.application">
      <cellTitle title="申请表" :num="1" />
      <cellMaterial :uploadOrViewType="1" :material="productMaterial.application" :is_required="productMaterial.application.is_required" :leftText="productMaterial.application.application_name" :rightText="(productMaterial.application.fileList && productMaterial.application.fileList.length)?'重新上传':'待上传'" />
    </cellItem>
    <cellItem v-if="productMaterial.take_along && productMaterial.take_along.length">
      <cellTitle title="赴馆携带材料" :num="productMaterial.take_along.length" />
      <cellMaterial :uploadOrViewType="2" :material="item" v-for="(item,index) in productMaterial.take_along" :is_required="item.is_required" :leftText="item.material_name" rightText="查看要求" />
    </cellItem>
    <cellItem v-if="productMaterial.paper_material && productMaterial.paper_material.length">
      <cellTitle title="纸质材料" :num="productMaterial.paper_material.length" />
      <cellMaterial :uploadOrViewType="2" :material="item" v-for="(item,index) in productMaterial.paper_material" :is_required="item.is_required" :leftText="item.material_name" rightText="查看要求" />
    </cellItem>
  </div>
</template>
<script setup>
import '@nutui/nutui/dist/packages/toast/style';
import btnPreviewDownLoad from '@/components/btnPreviewDownLoad/index.vue';
import cellItem from './cellItem.vue';
import cellMaterial from './cellMaterial.vue';
import cellTitle from './cellTitle.vue';
import { Edit, Plus, Del, Right } from '@nutui/icons-vue';
defineProps({
  productMaterial: {
    type: Object,
    default: {}
  }
})


</script>

<style lang="scss" scoped>
</style>